<!--子组建-->
<template>
    <div>
        <p>子组件:
            <span>{{title}}</span>
        </p>
        <button @click="childClick">点击我，切换数据</button>
    </div>
</template>
<script>
    export default {
        props: ['title'],
        data() {
            return {
                childValue: '我是子组件的数据'
            }
        },
        methods: {
            childClick() {
                this.$emit('update:title', `${this.childValue}`)
            }
        }
    }
</script>